home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PROGEDIT / 3181.ZIP / DOC.EXE / REGEXP.TXT < prev    next >
Text File  |  1993-09-16  |  2KB  |  52 lines

  1.                          Regular Expression Patterns
  2.                          ───────────────────────────
  3.  
  4.   a     Any ordinary character (not mentioned below) matches that character.
  5.  
  6.   \     The backslash quotes any character.  "\$" matches a dollar-sign.
  7.         n, t, r, f mean newline, tab, return, and form_feed respectively.
  8.  
  9.   ^     A circumflex at the beginning of an expression matches the
  10.         beginning of a line.
  11.  
  12.   $     A dollar-sign at the end of an expression matches the end of a line
  13.         including newline.
  14.  
  15.   *     An asterisk matches zero or more of any character.
  16.  
  17.   ?     A question mark matches any single character except a new_line.
  18.  
  19.   :a    A colon matches a class of characters described by the following
  20.   :d    character. 'a' - alpha, 'd' - decimal (0-9), 'n' - alphanumeric
  21.   :n    'w' - white space (matches spaces, tabs, and control chars.
  22.   :w
  23.  
  24.   @     An expression followed by an at sign matches zero or more
  25.         occurrances of that expression: "fo@" matches "f", "fo",
  26.         "foo", etc.
  27.  
  28.   +     An expression followed by a plus sign matches one or more
  29.         occurrances of that expression: "fo+" matches "fo", etc.
  30.  
  31.   -     An expression followed by a minus sign optionally matches
  32.         the expression (expression can be there or not).
  33.  
  34.   []    A string enclosed in square brackets matches ANY character in
  35.   [~]   that string, but no others.  If the first character in the
  36.         string is a ~, the expression matches any character NOT in the
  37.         string.  For example, "[xyz]" matches "xx" and "zyx", while
  38.         "[~xyz]" matches "abc" but not "axb".  A range of characters
  39.         may be specified by two characters separated by "-".  Note
  40.         that [a-z] matches alphabetics, while [z-a] never matches.
  41.  
  42.   .±d   A dot (.) followed by a + or - 1 to 9 causes the cursor to position
  43.         to that offset from the start of pattern.
  44.  
  45.   .c    A dot (.) followed by other than a + or - causes the cursor to
  46.         position to that character after the start of pattern.  If the
  47.         character is not found subsequent to the start of the pattern,
  48.         the cursor is placed on the first character of the pattern.
  49.         The dot operator may appear anywhere in the search pattern
  50.         except in [] where it would be taken literally.  A dot by
  51.         itself means position cursor to end of pattern.
  52.